package concurrency

import (
	"fmt"
	"sync"
	"time"
)

func main() {
	lock := sync.Mutex{}
	go printString(&lock, "A")
	go printString(&lock, "B")
	for {
	}
}

func printString(lock *sync.Mutex, str string) {
	for true {
		lock.Lock()
		fmt.Println(str)
		time.Sleep(time.Second * 1)
		lock.Unlock()
	}
}
